//
//  TestTableViewCell.m
//  GameBaby
//
//  Created by keyZhang on 13-12-29.
//  Copyright (c) 2013年 keyZhang. All rights reserved.
//

#import "TestTableViewCell.h"

@implementation TestTableViewCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
    }
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
 - (void)awakeFromNib
{
    [super awakeFromNib];
    _ratingView = [[ZhangqiRatingView alloc] initWithFrame:CGRectMake(100, 51, 80, 20) labelTextColor:[UIColor clearColor]];
    [self.contentView addSubview:self.ratingView];
    
}

- (void)layoutSubviews
{
    [super layoutSubviews];
//    self.ratimgView.scoreNum = 5.0;
    [self.headImg setImageWithURL:[NSURL URLWithString:self.model.img]];
    self.gameName.text = self.model.gamename;
    self.testTimeLabel.text = self.model.gametime;
    self.gType.text = self.model.gametype;
    _ratingView.userInteractionEnabled = NO;
    _ratingView.scoreNum = [self.model.score floatValue];
    
    switch ([self.model.gamestatus intValue]) {
        case 1:
            self.typeImg.image = [UIImage imageNamed:@"m_14X2.png"];
            break;
        case 2:
            self.typeImg.image = [UIImage imageNamed:@"m_26X2.png"];
            break;
        case 3:
            self.typeImg.image = [UIImage imageNamed:@"m_23X2.png"];
            break;
        case 4:
            self.typeImg.image = [UIImage imageNamed:@"gcX2.png"];
            break;
        default:
            break;
    }

}

@end
